import { mkdirSync,existsSync } from "node:fs";
import {writeFile} from "node:fs/promises";
import { join } from "node:path";

const baseQps='./src/.qps';
const baseExports='./src/.qps/exports.ts';

export const createFolderCache=(projectRoot)=>{

    const path=join(projectRoot,baseQps);

    if(existsSync(path)){
        return true;
    }

   return  mkdirSync(path, { recursive: true});
};
 
export  const createExports=(code,projectRoot)=>{
     const path=join(projectRoot,baseExports);
     writeFile(path,code);   
};